package org.example.admin.utils;

import org.apache.commons.text.RandomStringGenerator;

public class StringUtils {

    /** 生成指定长度字符串，字符包括 a-zA-Z0-9 */
    public static String generateRandomString(int length) {
        RandomStringGenerator generator = new RandomStringGenerator.Builder()
                .withinRange(new char[]{'a', 'z'}, new char[]{'A', 'Z'}, new char[]{'0', '9'})
                .build();

        return generator.generate(length);
    }
}
